# -*- perl -*-

# t/001_load.t - check module loading and create testing directory

use lib 'lib';
use Test::More tests => 12;

BEGIN {
    use_ok('OOXML::Utils::Presentation');
}

# Check we can create objects
my $pptx = OOXML::Utils::Presentation->new();
isa_ok($pptx, 'OOXML::Utils::Presentation');

# Check we can read files into objects
is($pptx->init_from_file('t/samples/sample.pptx'), 1,
   'Can we read sample presentation document?');

is($pptx->get_number_of_slides(), 2, "Have we found 2 slides?");

is($pptx->delete_slide(3), 0, "Can we delete non-existent slide?");
is($pptx->delete_slide(-1), 0, "Can we delete non-existent slide?");
is($pptx->delete_slide(-110), 0, "Can we delete non-existent slide?");
is($pptx->delete_slide(0), 0, "Can we delete non-existent slide?");

is($pptx->delete_slide(2), 1, "Can we delete 2nd slide?");
is($pptx->get_number_of_slides(), 1, "Have we found 1 slide?");

is($pptx->delete_slide(1), 1, "Can we delete 1st slide?");
is($pptx->get_number_of_slides(), 0, "Have we found 0 slides?");
